; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=instcombine < %s | FileCheck %s
; Check that there's a call one call to @objc_msgSend_fpret with a
; float result

target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
%struct.NSObject = type { ptr }
%struct.NSArray = type { %struct.NSObject }
%struct.objc_class = type opaque
%struct.objc_selector = type opaque

@"\01L_OBJC_METH_VAR_NAME_112" = internal global [15 x i8] c"whiteComponent\00", section "__TEXT,__cstring,cstring_literals"
@"\01L_OBJC_SELECTOR_REFERENCES_81" = internal global ptr @"\01L_OBJC_METH_VAR_NAME_112", section "__OBJC,__message_refs,literal_pointers,no_dead_strip"

define void @bork() nounwind  {
; CHECK-LABEL: @bork(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[COLOR:%.*]] = alloca ptr, align 8
; CHECK-NEXT:    [[TMP103:%.*]] = load ptr, ptr [[COLOR]], align 8
; CHECK-NEXT:    [[TMP105:%.*]] = load ptr, ptr @"\01L_OBJC_SELECTOR_REFERENCES_81", align 8
; CHECK-NEXT:    [[TMP107:%.*]] = call float @objc_msgSend_fpret(ptr [[TMP103]], ptr [[TMP105]]) #[[ATTR0:[0-9]+]]
; CHECK-NEXT:    br label [[EXIT:%.*]]
; CHECK:       exit:
; CHECK-NEXT:    ret void
;
entry:
  %color = alloca ptr
  %color.466 = alloca ptr
  %tmp103 = load ptr, ptr %color, align 4
  store ptr %tmp103, ptr %color.466, align 4
  %tmp105 = load ptr, ptr @"\01L_OBJC_SELECTOR_REFERENCES_81", align 4
  %tmp106 = load ptr, ptr %color.466, align 4
  %tmp107 = call float @objc_msgSend_fpret( ptr %tmp106, ptr %tmp105 ) nounwind
  br label %exit

exit:
  ret void
}

declare void @objc_msgSend_fpret(ptr, ...)
